package com.rstrulak.constant;

public class PresentationInfo {
    /** Requested or received paging. */
    private PageInfo pageInfo;

    /** Requested sorting. */
    private SortInfo sortInfo;

    /**
     * Default constructor.
     */
    public PresentationInfo() {
    }

    /**
     * Creates PresentationInfo with pageInfo variable set.
     * 
     * @param pageInfo .
     */
    public PresentationInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

    /**
     * Creates PresentationInfo with sortInfo variable set.
     * 
     * @param sortInfo .
     */
    public PresentationInfo(SortInfo sortInfo) {
        this.sortInfo = sortInfo;
    }

    /**
     * Creates PresentationInfo with pageINfo and sortInfo variable set.
     * 
     * @param pageInfo .
     * @param sortInfo .
     */
    public PresentationInfo(PageInfo pageInfo, SortInfo sortInfo) {
        this.pageInfo = pageInfo;
        this.sortInfo = sortInfo;
    }

    /**
     * Determines whether this object includes paging informations.
     * 
     * @return true if it does
     */
    public boolean isPagingIncluded() {
        return pageInfo != null;
    }

    /**
     * Determines whether this object includes sorting informations.
     * 
     * @return true if it does
     */
    public boolean isSortingIncluded() {
        return sortInfo != null;
    }

    public PageInfo getPageInfo() {
        return pageInfo;
    }

    public SortInfo getSortInfo() {
        return sortInfo;
    }

    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

    public void setSortInfo(SortInfo sortInfo) {
        this.sortInfo = sortInfo;
    }
}
